<template>
  <el-select
    v-model="selected"
    clearable
    filterable
    :placeholder="$language.local('请选择')"
    @change="selectChange"
    class="el-select"
  >
    <el-option
      v-for="item in options"
      :key="item.value"
      :label="item.label"
      :value="item.value"
    >
    </el-option>
  </el-select>
</template>

<script>
export default {
  props: ["value"],
  data() {
    return {
      selected: this.value,
      options: [
        {
          label: "T+1结算",
          value: 1,
        },
        {
          label: "当月结算",
          value: 2,
        },
        {
          label: "次月结算",
          value: 3,
        },
        {
          label: "次次月结算",
          value: 4,
        },
      ],
    };
  },

  watch: {
    value(newValue) {
      this.selected = newValue;
    },
  },

  methods: {
    selectChange(e) {
      this.$emit("input", e);
    },
  },
};
</script>

<style lang="less" scoped>
.el-select {
  width: 100%;
}
</style>
